<?php $this->load->module('mobile/index/header', $common);?>
<div class="content">
    <div id="list">
        <?php foreach ($datalist as $v) { ?>
            <a href="<?php echo $v['link']?>">
                <div class="list-item fn-clear">
                    <div class="pic">
                        <img src="<?php echo $v['file_url'];?>" onerror="this.error=null;this.src='<?php echo URLPRE;?>static/public/images/nophoto.jpg'">
                    </div>
                    <div class="info">
                        <div class="i-note">
                            <p class="price"><?php echo $v['realname'];?> </p>
                            <p class="c_mt">特长：<?php echo sub_str($v['speciality'],'0','15','utf-8');?></p>
                            <p class="c_mt"><?php echo sub_str($v['profile'],'0','30','utf-8');?></p>
                        </div>

                    </div>
                    <span class="arrow-right"></span>
                </div>
            </a>
        <?php }?>
    </div>
    <a href="javascript:;" class="btn-grey btn">加载更多</a>
</div>
<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    $(function(){
        var slid = $("#sliderimg").slider({
            loop: true
        });
        var page = <?php echo $page+1;?>;
        var url = '<?php echo site_url('mobile/expert/index');?>';
        $('.btn-grey').click(function(){
            var $this = $(this);
            $this.text('加载中...');
            $.get(url+(url.indexOf('?')!=-1 ?'&':'/?')+'isajax=1&page='+page, function(data){
                if(data.length>0){
                    var html = '';
                    for(var i =0; i<data.length; i++){
                        var item = data[i];
                        html += '<a href="'+ item.link +'">' +
                        '<div class="list-item fn-clear"><div class="pic">' +
                        '<img src="'+ item.file_url +'" onerror="this.error=null;this.src=\'<?php echo URLPRE;?>static/public/images/nophoto.jpg\'">' +
                        '</div><div class="info">' +
                        '<h5>'+ item.realname +'</h5>' +
                        '<div class="i-note"><p><span class="price">'+item.speciality+'</span></p>' +
                        '<p><span>'+ item.profile +'</span></p>' +
                        '</div></div><span class="arrow-right"></span></div></a>';
                    }
                    $('#list').append(html);
                    page ++;
                    $this.text('加载更多');
                }else{

                    $.dialog({
                        style:'tip',
                        width:200,
                        closeTime:1000,
                        content: '<p style="text-align: center">没有更多了</p>'
                    }).open();
                    $this.text('没有更多了');
                }

            },'json');
        });

    });
</script>